package com.ajax.service;

import com.ajax.Dao.UserDAO;
import com.ajax.entity.User;

//
public class UserService {
   private UserDAO  userDAO=new UserDAO();

    public static void main(String[] args) {
        User king = new UserService().getUserByName("king");
        System.out.println(king);
    }
    public User getUserByName(String username){
        User user = userDAO.querySingle("select * from user where username=?", User.class, username);
        return user;
    }
}
